package pool;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * 返回结果标签
 *
 * @author c_jia
 */
public class TagEntity {


  public String word;


  public String url;


  public String historyWord;


  public Corner corner;


  public String type;


  public TagEntity(String word, String url, String historyWord) {
    this.word = word;
    this.url = url;
    this.historyWord = historyWord;
  }


  public TagEntity(String word, String url, String historyWord, String type) {
    this.word = word;
    this.url = url;
    this.historyWord = historyWord;
    this.type = type;
  }

  /**
   * DocList转tagList
   */
  public static List<TagEntity> newTagList(List<IndexDoc> docList) {
    List<TagEntity> tagList = Lists.newArrayList();
    docList.forEach(doc -> {
      tagList.add(new TagEntity(doc.word, doc.url, doc.word));
    });
    return tagList;
  }

}
